#ifndef __VECTOR_H__
#define __VECTOR_H__

namespace Splatit {

/**
 *  3D Vector class.
 */

struct Vector {
	/**
	 * Simple constructor.
	 * @param _x X value
	 * @param _y Y value
	 * @param _z Z value
	 */
	Vector(const double _x,const double _y,const double _z);
	
	/**
	 * Default constructor.
	 * Boost Serialization needs a default constructor
	 * @see Vector(const Vector&)
	 */
	Vector(void);
	
	/**
	 * Copy constructor.
	 */
	Vector(const Vector& _vector);
	
	/**
	 * Destructor
	 */
	~Vector(void);

	/**
	 * Dot product operation.
	 * It is the standard inner product.
	 */
	double dot_product(const Vector& _vector) const;
	
	/**
	 * Scalar Product operation.
	 * This function will be renamed.
	 * @see operator*()
	 */
	Vector scalar_product(double _value) const;
	
	/**
	 * Cross product operation.
	 * Also known as the vector product.
	 * Construct a perpendicular vector from this and _vector.
	 */
	Vector cross_product(const Vector& _vector) const;
	
	/**
	 * Subtraction operation.
	 * @see operator-()
	 */
	Vector sub_vect(const Vector& _vector) const;
	
	/**
	 * Normalization.
	 * A normalized vector is a vector with lenght 1.
	 * @return A normalized vector.
	 */
	Vector normalize(void) const;
	
	/**
	 * Length of a vector.
	 * @return The length.
	 */
	double length(void) const;
	double distance(const Vector& _vector) const;
	
	void set(const double _x,const double _y,const double _z);
	
	Vector& operator=(const Vector&);
	double operator*(const Vector& _vector) const;
	const Vector operator*(const double _value) const;
	const Vector operator+(const Vector& _vector) const;
	double operator[](const int& _index) const;
	const Vector operator-(void) const;
	const Vector operator-(const Vector& _vector) const;

	double x,y,z; 
};

}

#endif
